<?php

class roleModel extends CDBModelBase
{
	public function getTabelName(){
		return "tbl_base_role";
	}

	public function getPKID(){
		return "role_id";
	}
	
	protected function getSequence()
	{
		return "ROLE_SEQUENCE";
	}
		
	/**
	 * 更新角色删除标记，删除角色模块记录
	 * @param int $role_id
	 * @desc $rtn = $obj->delete(100);
	 */
	public function delete($roleId)
	{
		$this->deleteByPkId($roleId);
		$params = array(array(":role_id", $roleId,PDO::PARAM_INT));
		return $this->db->executeNonQuery("delete from tbl_base_role_module where role_id=:role_id",$params);
	}
	

	/**
	 * 获取所有角色
	 */
	public function selectAll()
	{
		return $this->db->executeDataSet("select * from tbl_base_role where del_flag=0");
	}
}




?>